# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Karolina Lindqvist <karolina.lindqvist@kramnet.se>

pkgname=(algol68g algol68g-doc)
pkgver=3.1.9
pkgrel=1
pkgdesc='Algol 68 compiler and interpreter'
arch=(loong64 x86_64)
url='https://jmvdveer.home.xs4all.nl/algol.html'
license=(GPL)
depends=(gsl mpfr plotutils)
optdepends=('postgresql-libs: for postgresql support')
source=("https://jmvdveer.home.xs4all.nl/algol68g-$pkgver.tar.gz"
        'https://ftp.tw.freebsd.org/distfiles/a68g-doc.pdf')
b2sums=('a29010db264c012720c9db97c089311c4400ea88cdabc8cfa9e1345d2e401a50a80511ba88a7a8dbb118a99699cba412e291e59b46c150e4ffc6dc5de0733770'
        'f8ca710d9a4f611873de41785e70359bd566645268ebb848803d3cd2e9a9f873f8ac423e3e08699998083444b7f6d98df32fdb7a4c6b36692462ee50ddb1e410')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

package_algol68g() {
  make -C $pkgname-$pkgver \
    DESTDIR="$pkgdir" \
    docdir=/usr/share/doc/$pkgname \
    install
}

package_algol68g-doc() {
  install -Dm644 a68g-doc.pdf \
    "$pkgdir/usr/share/doc/algol68g/learning_algol.pdf"
}
